package com.sj.parksdk.net.http;

import com.sj.parksdk.ParkSdk;
import com.sj.parksdk.setting.Constans;

public class MyNetApi {
    //天气
    public static final String WEATHER_API = "http://wthrcdn.etouch.cn/weather_mini";
    public static final String WEATHER_CITY = "city";

    //认证
    public static final String TOKEN_ANONYMOUS = "api/v1/token/anonymous";

    public static final String TOKEN_REFRES_TOKEN = "api/v1/token/refresh";

    public static class RefreshToken extends Cetificat<RefreshToken> {
        private String refresh_token;

        public String getRefresh_token() {
            return refresh_token;
        }

        public void setRefresh_token(String refresh_token) {
            this.refresh_token = refresh_token;
        }
    }

    //login
    public static final String LOGIN_LOGIN = "api/v1/account/login";

    public static class Cetificat<R extends Cetificat> {
        private String appId = Constans.APP_ID;
        private String deviceType = Constans.DEVICE_TYPE;
        private String deviceId = ParkSdk.getDeviceId();
        private String version = "1.0.0";

        public String getAppId() {
            return appId;
        }

        public R setAppId(String appId) {
            this.appId = appId;
            return (R) this;
        }

        public String getDeviceType() {
            return deviceType;
        }

        public R setDeviceType(String deviceType) {
            this.deviceType = deviceType;
            return (R) this;
        }

        public String getDeviceId() {
            return deviceId;
        }

        public R setDeviceId(String deviceId) {
            this.deviceId = deviceId;
            return (R) this;
        }

        public String getVersion() {
            return version;
        }

        public R setVersion(String version) {
            this.version = version;
            return (R) this;
        }
    }

    public static class LoginPassword extends Cetificat {
        private String username;
        private String password;

        public String getUsername() {
            return username;
        }

        public LoginPassword setUsername(String username) {
            this.username = username;
            return this;
        }

        public String getPassword() {
            return password;
        }

        public LoginPassword setPassword(String password) {
            this.password = password;
            return this;
        }
    }

    public static final String LOGIN_SENG_MESSAGE = "api/v1/sms/send";

    public static class LoginPone {
        private String phone;
        private String code;
        private String type;

        public String getPhone() {
            return phone;
        }

        public LoginPone setPhone(String phone) {
            this.phone = phone;
            return this;
        }

        public String getCode() {
            return code;
        }

        public LoginPone setCode(String code) {
            this.code = code;
            return this;
        }

        public String getType() {
            return type;
        }

        public LoginPone setType(String type) {
            this.type = type;
            return this;
        }
    }

    public static final String LOGIN_PHONE_LOGIN = "api/v1/account/phoneLogin";
    public static final String LOGIN_VERTIFY_CODE = "api/v1/sms/verify";
    public static final String LOGIN_RESET_PASSWORD = "api/v1/user/resetPassword";

    public static class UpdatePassword {
        private String password;
        private String token;

        public String getPassword() {
            return password;
        }

        public UpdatePassword setPassword(String password) {
            this.password = password;
            return this;
        }

        public String getToken() {
            return token;
        }

        public UpdatePassword setToken(String token) {
            this.token = token;
            return this;
        }
    }

    public static final String LOGIN_OUT = "api/v1/account/logout";

    //用户数据
    public static final String USER_INFO = "api/v1/user/info";
    public static final String USER_COUPONS = "api/v1/user/coupons";

    public static class Coupons {
        public static final String STATE = "state";
    }

    public static final String USER_COUPONS_RECEIVE = "api/v1/user/coupons/receive";

    public static class CouponsReceive {
        public CouponsReceive(String code) {
            this.code = code;
        }

        private String code;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }
    }

    //车场相关
    public static final String PARK_LOTS_NEARBY = "api/v1/parkingLots/nearby";

    public static class PageParam {
        public static final String pageSize = "pageSize";//
        public static final String pageIndex = "pageIndex";//
        public static final String startTime = "startTime";//
        public static final String endTime = "endTime";//
    }

    public static class PakLotsNearby extends PageParam {
        public static final String longitude = "longitude";
        public static final String latitude = "latitude";
        public static final String range = "range";//范围(单位公里)
        public static final String status = "status";//车场状态 否
        public static final String category = "category";//车场分类 否
        public static final String coordinateType = "coordinateType";//坐标系类型,默认 WGS84 否
        public static final String keyword = "keyword";//搜索关键字 否
    }

    //车辆相关
    public static final String CAR_CARS = "api/v1/user/cars";

    public static final String CAR_ADD_CAR = "api/v1/user/cars/add";

    public static class CarAdd {
        private String carNo;
        private String plateColor;

        public CarAdd(String carNo, String color) {
            this.carNo = carNo;
            this.plateColor = color;
        }

        public String getCarNo() {
            return carNo;
        }

        public void setCarNo(String carNo) {
            this.carNo = carNo;
        }

        public String getPlateColor() {
            return plateColor;
        }

        public void setPlateColor(String plateColor) {
            this.plateColor = plateColor;
        }
    }

    public static final String CAR_DELETE = "api/v1/user/cars/";

    //停车相关
    public static final String PARK_RECORD = "api/v1/user/park/orders";
    public static final String PARK_RECORD_UNFINISH = "api/v1/user/park/chargeOrders";
    public static final String PARK_ORDER_PICS = "api/v1/park/orders/";

    public static class Park {
        public static final String carNo = "carNo";
    }

    //ocr
    public static final String OCR_IDCARD = "api/v1/ocr/idcard";
    public static final String USER_CERtiFICATE = "api/v1/user/certification/verify";

    public static class UserCertificate {
        private String name, idNo, startDate, endDate;

        public String getName() {
            return name;
        }

        public UserCertificate setName(String name) {
            this.name = name;
            return this;
        }

        public String getIdNo() {
            return idNo;
        }

        public UserCertificate setIdNo(String idNo) {
            this.idNo = idNo;
            return this;
        }

        public String getStartDate() {
            return startDate;
        }

        public UserCertificate setStartDate(String startDate) {
            this.startDate = startDate;
            return this;
        }

        public String getEndDate() {
            return endDate;
        }

        public UserCertificate setEndDate(String endDate) {
            this.endDate = endDate;
            return this;
        }
    }

    public static final String USER_CERTIFICAT_INFO = "api/v1/user/certification/info";

    public static final String OCR_CARLICENSE = "api/v1/ocr/vehicleLicense";
    public static final String CAR_CANVERIFY = "api/v1/user/cars/";
    public static final String CAR_CERTIFICATE = "api/v1/user/cars/";

    public static class CarCertificate {
        private long id;
        private String carNo, owner, registerDate;

        public long getId() {
            return id;
        }

        public CarCertificate setId(long id) {
            this.id = id;
            return this;
        }

        public String getCarNo() {
            return carNo;
        }

        public CarCertificate setCarNo(String carNo) {
            this.carNo = carNo;
            return this;
        }

        public String getOwner() {
            return owner;
        }

        public CarCertificate setOwner(String owner) {
            this.owner = owner;
            return this;
        }

        public String getRegisterDate() {
            return registerDate;
        }

        public CarCertificate setRegisterDate(String registerDate) {
            this.registerDate = registerDate;
            return this;
        }
    }

    //套餐
    public static final String PACKAGE_PACKAGES = "api/v1/parkingLots/";
    public static final String PACKAGE_CREATE_ORDER = "api/v1/user/park/packages/createOrder";
    public static final String PACKAGE_ORDER_RECORD = "api/v1/user/park/packages/historyOrders";
    public static class PackageCreateOrderBody{
        private long carId;
        private long parkingLotId;
        private long packageId;
        private long packageItemId;

        public long getCarId() {
            return carId;
        }

        public PackageCreateOrderBody setCarId(long carId) {
            this.carId = carId;
            return this;
        }

        public long getParkingLotId() {
            return parkingLotId;
        }

        public PackageCreateOrderBody setParkingLotId(long parkingLotId) {
            this.parkingLotId = parkingLotId;
            return this;
        }

        public long getPackageId() {
            return packageId;
        }

        public PackageCreateOrderBody setPackageId(long packageId) {
            this.packageId = packageId;
            return this;
        }

        public long getPackageItemId() {
            return packageItemId;
        }

        public PackageCreateOrderBody setPackageItemId(long packageItemId) {
            this.packageItemId = packageItemId;
            return this;
        }
    }

    //订单相关
    public static final String CHARGE_OVER_VIEW = "api/v1/user/park/chargeOrders/overview";
    public static final String ORDER_CALCULATEPRICE = "api/v1/park/orders/{orderNo}/calculatePrice";
    public static final String ORDER_PAY_RECORD = "api/v1/user/park/trades";
    public static final String ORDER_PAY_RECORD_DETAIL = "api/v1/user/park/trades/";

    //广告位
    public static final String BANNERS = "api/v1/banners";

    //支付相关
    public static final String PAY_FREETRADE = "api/v1/park/payFreeTrade";
    public static final String PAY_PREPAYMENT = "api/v1/park/prepayment";
    public static final String PAY_WEIPAY_QRCODE = "api/v1/wechat/pay/native/prepay";
    public static class Pay{
        private String tradeNo;
        private String sign;
        private long timestamp;

        public String getTradeNo() {
            return tradeNo;
        }

        public Pay setTradeNo(String tradeNo) {
            this.tradeNo = tradeNo;
            return this;
        }

        public String getSign() {
            return sign;
        }

        public Pay setSign(String sign) {
            this.sign = sign;
            return this;
        }

        public long getTimestamp() {
            return timestamp;
        }

        public Pay setTimestamp(long timestamp) {
            this.timestamp = timestamp;
            return this;
        }
    }
    public static class PrePay{
        private String carNo;
        private long parkingLotId;
        private Long couponId;

        public String getCarNo() {
            return carNo;
        }

        public PrePay setCarNo(String carNo) {
            this.carNo = carNo;
            return this;
        }

        public long getParkingLotId() {
            return parkingLotId;
        }

        public PrePay setParkingLotId(long parkingLotId) {
            this.parkingLotId = parkingLotId;
            return this;
        }

        public Long getCouponId() {
            return couponId;
        }

        public PrePay setCouponId(Long couponId) {
            this.couponId = couponId;
            return this;
        }
    }
}
